Skip to content

refactor: converge Maestro assertion waits#625

Merged
thymikee merged 2 commits into
mainfrom
refactor/maestro-assertion-wait-convergence
May 30, 2026
Merged

refactor: converge Maestro assertion waits#625
thymikee merged 2 commits into
mainfrom
refactor/maestro-assertion-wait-convergence

Conversation

@thymikee

Copy link
Copy Markdown
Member

Summary

Refactors Maestro visibility assertions so assertVisible and assertNotVisible share one Maestro visibility sampler while preserving the native is visibility predicate semantics already used by the resolver.

Routes extendedWaitUntil.notVisible through the Maestro not-visible assertion path with its timeout, so absent targets pass consistently instead of falling through native is hidden selector-not-found behavior.

Documents why assertVisible and waitForAnimationToEnd keep Maestro-specific polling where native wait/is are not semantically equivalent.

Touched files: 5.

Validation

Focused Maestro assertion/replay tests passed, including the full focused replay file outside the sandbox for its local HTTP fixture. Typecheck passed with the pinned Node/pnpm path. pnpm format passed with the pinned Node/pnpm path; unrelated formatter churn was restored.

Known gaps: no broad provider-scenario sweep; this change is scoped to assertion/wait convergence and preserves existing Maestro polling where native semantics differ.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 4235852dbf

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread src/compat/maestro/runtime-assertions.ts Outdated

@thymikee thymikee left a comment

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review — converge Maestro assertion waits

This is a good correctness and convergence change. Sharing one visibility sampler between assertVisible/assertNotVisible removes a duplicated snapshot-resolution path, and routing extendedWaitUntil.notVisible through the not-visible assertion is actually more Maestro-faithful than the old wait(timeout) + is hidden: native is hidden fails on a selector that doesn't resolve at all, whereas Maestro treats an absent (or overlay-blocked) target as "not visible → pass." The inline comments explaining why native wait/is can't replace these loops are exactly the rationale that should live next to this code.

I checked the behavior-preservation points and they hold:

  • assertVisible default timeout stays 5000ms (now via defaultTimeoutMs).
  • Plain assertNotVisible keeps the 3000ms default (defaultAssertNotVisibleTimeoutMs), while extendedWaitUntil.notVisible now forwards its own readTimeoutMs(..., 30000). So the long extended-wait window is preserved and the bare command's stability window is unchanged.
  • Infrastructure failures (snapshot capture/parse) still short-circuit instead of being counted as "hidden."

One behavioral nuance worth a sanity check: the new waitedMs >= timeoutMs exit lets assertNotVisible pass on a single hidden sample once the (possibly very short) timeout is reached, where the default path still wants hiddenSamples >= 2. That's the right trade-off for explicit short extendedWaitUntil timeouts, but please confirm there's no flow relying on the old "always require 2 stable hidden samples" guarantee with a sub-poll-interval timeout — the new timeout: 1 test passes precisely because of this branch.

Looks good to merge.


Generated by Claude Code

@thymikee thymikee merged commit 7f2c2b7 into main May 30, 2026
17 checks passed
@thymikee thymikee deleted the refactor/maestro-assertion-wait-convergence branch May 30, 2026 13:45
@github-actions

Copy link
Copy Markdown
PR Preview Action v1.8.1
Preview removed because the pull request was closed.
2026-05-30 13:45 UTC

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant